<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>前台首页</title>
<!-- 导入主题样式 -->
<!-- <link rel="stylesheet" href="../../public/easyui/themes/bootstrap/easyui.css" /> -->
<!-- 导入图标库 -->
<link rel="stylesheet" href="../../public/easyui/themes/icon.css" /> 
<!-- js文件，顺序：jq，easyui，国际化包 -->
<link rel="stylesheet" href="../../public/css/front.css" />
<link rel="stylesheet" href="../../public/css/front_head.css" />
<link rel="stylesheet" href="../../public/css/publish.css" />
<script type="text/javascript" src="../../public/js/jquery.min.js"></script>
<script type="text/javascript" src="../../public/js/front_work.js"></script>

</head>
<body
	style="background-image: url(../../public/images/bg_text.png); background-repeat: no-repeat;">
	<jsp:include page="../header.jsp"></jsp:include>
	<div class="welcome">
		亲爱的『${user.name}』${user.student.gender == '男' ? '帅哥' : '美女'}，今天是2018年1月7日，株洲天气：<span id="weather">小雨，当前气温：2度</span>。欢迎您使用新职课JAVA学习平台，祝您学习进步，成为IT界的精英^_^……
	</div>


	<div class="easyui" fit="true">
		<div data-options="region:'center'" style="border: 0">
			<h1>Hollow word</h1>
			<fieldset class="fs">
				<legend>基本信息</legend>
				<div class="">
					<div class="exam_info">【试卷名称】：TR09-${ct.name}</div>
					<div class="exam_info">【考生】： ${user.name}</div>
					<div class="exam_info">【考试内容】： 《${zj.dagang.name}》</div>
					<div class="exam_info">
						【涉及章节】：
						<c:forEach items="${ct.cla}" var="c">
	   				【${zj.name}】
	   			</c:forEach>

					</div>
					<div class="exam_info">【说明】：${empty ct.remark ? '无' : ct.remark}
					</div>
				</div>
			</fieldset>
			<form id="workFrom" method="post">
				<input type="hidden" id="workid" name="workid" value="${ct.id}">
				<div>
					<input type="hidden" id="zjid" value="${zj.id}" />
					<c:if test="${not empty choise.choises}">
					<fieldset
						style="border: none; width: 96%; margin-top: 10px; margin-left: 20px;">
						<legend style="font-weight: bold; padding-bottom: 10px;">选择题(共${choise.choises.size()}题)</legend>
						<ol type="1" class="borderw" style="padding-left: 40px;">
							<c:forEach items="${choise.choises}" var="c" varStatus="status">
								<li class="li_question">
									<div class="question_title">
										${c.title}(选${c.answer.length()}项) <span
											class="correct_answer"></span>
									</div>
									<ol type="A" style="padding-left: 0px;">
										<c:choose>
											<c:when test="${c.answer.length() == 1}">
												<input type="hidden" name="answercid" value="${c.id }" />
												<li><label> <input
														<c:if test="${fn:contains(choise.choisesanswer[status.index].answer,'A')==true}">
				 					checked 
							    </c:if>
														name="answer_${c.id }" type="radio" value="A">${c.optionA}
												</label></li>
												<li><label> <input
														<c:if test="${fn:contains(choise.choisesanswer[status.index].answer,'B')==true}">
				 					checked 
							    </c:if>
														name="answer_${c.id }" type="radio" value="B">${c.optionB}</label></li>
												<li><label> <input
														<c:if test="${fn:contains(choise.choisesanswer[status.index].answer,'C')==true}">
				 					checked 
							    </c:if>
														name="answer_${c.id }" type="radio" value="C">${c.optionC}</label></li>
												<li><label> <input
														<c:if test="${fn:contains(choise.choisesanswer[status.index].answer,'D')==true}">
				 					checked 
							    </c:if>
														name="answer_${c.id }" type="radio" value="D">${c.optionD}</label></li>
											</c:when>
											<c:otherwise>
												<input type="hidden" name="answercid" value="${c.id }" />
												<li><label><input
														<c:if test="${fn:contains(choise.choisesanswer[status.index].answer,'A')==true}">
				 					checked 
							    </c:if>
														name="answer_${c.id }" type="checkbox" value="A">${c.optionA}</label></li>
												<li><label><input
														<c:if test="${fn:contains(choise.choisesanswer[status.index].answer,'B')==true}">
				 					checked 
							    </c:if>
														name="answer_${c.id }" type="checkbox" value="B">${c.optionB}</label></li>
												<li><label><input
														<c:if test="${fn:contains(choise.choisesanswer[status.index].answer,'C')==true}">
				 					checked 
							    </c:if>
														name="answer_${c.id }" type="checkbox" value="C">${c.optionC}</label></li>
												<li><label><input
														<c:if test="${fn:contains(choise.choisesanswer[status.index].answer,'D')==true}">
				 					checked 
							    </c:if>
														name="answer_${c.id }" type="checkbox" value="D">${c.optionD}</label></li>
											</c:otherwise>
										</c:choose>

									</ol>
								</li>
							</c:forEach>
						</ol>
					</fieldset>
					
					</c:if>
					
					<c:if test="${not empty opinion.opinions}">
					<fieldset
						style="border: none; width: 96%; margin-top: 10px; margin-left: 20px;">
						<legend style="font-weight: bold; padding-bottom: 10px;"">判断题(共${opinion.opinions.size()}题)</legend>
						<ol type="1" class="borderw" style="padding-left: 40px;">
							<c:forEach items="${opinion.opinions}" var="o"  varStatus="status">
								<li class="li_question">
									<div class="question_title">
										<input type="hidden" name="answeroid" value="${o.id }" /> <label>
										<input ${opinion.opinionsanswer[status.index].answer == '对' ? 'checked' : ''}
											name="answer_${o.id }" type="radio" value="对">√</label> <label>
										<input ${opinion.opinionsanswer[status.index].answer == '错' ? 'checked' : ''}
											name="answer_${o.id }" type="radio" value="错">×</label>
										${o.title}
									</div>
								</li>
							</c:forEach>
						</ol>
					</fieldset>
					
					</c:if>
					<c:if test="${not empty program.programs}">
					<fieldset
						style="border: none; width: 96%; margin-top: 10px; margin-left: 20px;">
						<legend style="font-weight: bold; padding-bottom: 10px;"">编程题(共${program.programs.size()}题)</legend>
						<ol type="1" class="borderw" style="padding-left: 40px;">
							<c:forEach items="${program.programs}" var="p" varStatus="status">
								<li class="li_question"><input type="hidden" name="answerpid" value="${p.id }" />
									<div class="question_title">
										<a name="m648"></a> <pre>${p.title}</pre>
									</div><pre> <textarea class="per80" style="height: 250px;"
										name="answer_${p.id}">${program.programsanswer[status.index].answer}</textarea></pre></li>
							</c:forEach>
						</ol>
					</fieldset>
					</c:if>
				</div>
			</form>
		</div>

		<span class="two" style="    padding-right: 135px;">
		 <a id="subbtn" iconCls="icon-save" class="easyui-linkbutton">我要提交</a>
		</span>
		 <span class="from_left" style="padding-left: 70px;"> 
			<a id="savebtn" class="easyui-linkbutton blue_btn" 	iconCls="icon-save">保存暂不提交</a> &nbsp;&nbsp;&nbsp;
			<a onclick="location='/front_page'" iconCls="icon-cancel" class="easyui-linkbutton qing_btn_sh">退出答题</a>
		</span>
	</div>

</body>
</html>